package com.softeem.work.w2;

public class People {
    private String name;
    private int age;

    public People() {
    }

    public People(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "People{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void eat(){
        System.out.println("吃饭");
    }

    //添加信息的方法
    public boolean add(String name,int age){
        boolean flag = false;
        if(age >= 25 && age <= 45){
            flag = true;
        }
        //名字都能够进行添加
        return flag;
    }

}
